repo: Store transaction file, use it to optimize for pull resumes
authorColin Walters <walters@verbum.org>
Mon, 8 Jul 2013 13:05:34 +0000 (09:05 -0400)
committerColin Walters <walters@verbum.org>
Mon, 8 Jul 2013 13:05:34 +0000 (09:05 -0400)
commit56f8584fe4034c2cc018f8d48139a97498e34d2f
tree18fe0cc6d98f8090f50cc8483865db10c25e47ed
parent305cd02e0c15205d61f4e040003333d66d6bd7cf
repo: Store transaction file, use it to optimize for pull resumes

If pull is interrupted, we may have downloaded an arbitrary subset of
the requested objects.  Previously, we handled this by scanning for
all objects each time.

However, there's an easy optimization - this patch creates a lock file
in the repo.  If we don't see that file when starting a pull, we know
we don't need to stat() every file; presence of a dirtree object for
example implies the existence of everything it references.
src/libostree/ostree-repo.c
src/libostree/ostree-repo.h
src/ostree/ostree-pull.c
src/ostree/ot-builtin-commit.c
src/ostree/ot-builtin-pull-local.c